import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";
import Login from "../views/Login.vue";
import About from "../views/About.vue";
import Editor from "../views/Editor.vue";
import HomeIndexs from "../views/home/Index.vue";
import UserManagement from "../views/set/userManagement.vue";
Vue.use(VueRouter);
 
const routes = [
	{
		path: "/home",
		name: "Home",
		component: Home,
		children:[
			{
				path: '/home/index',
				component: HomeIndexs,
				meta:{
					open:'',
					navkey:'1'
				},
			},
			
			{
			  path: '/',
			  redirect: '/home/index'
			}
			
		]
		
	},
	{
		path: '/set',
		component: Set,
		children:[
			{
				path: '/set/userManagement',
				component: UserManagement,
				meta:{
					open:'1',
					navkey:'2'
				},
			},
		],
		meta:{
			test:'1'
		},
	},
	{
	  path: '/',
	  redirect: '/home'
	},
	{
		path: "/editor",
		name: "Editor",
		component: Editor
	},
	{
		path: "/login/:age/:id",
		name: "Login",
		component: Login
	},
	{
		path: "/about/:id",
		name: "About",
		component: About
	},

];

const router = new VueRouter({
	mode: "history",
	base: process.env.BASE_URL,
	routes
});

export default router;
